package com.example.springbootusecase.service.impl;

import cn.hutool.json.JSONUtil;
import com.example.springbootusecase.bo.User;
import com.example.springbootusecase.bo.UserContextHolder;
import com.example.springbootusecase.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author Think
 */
@Slf4j
@Service
public class UserServiceImpl implements UserService {
    @Override
    public User getUser() {
        log.info("UserService线程:{},user:{}",Thread.currentThread().getName(), JSONUtil.toJsonStr(UserContextHolder.getUser()));
        return UserContextHolder.getUser();
    }
}
